import request from '@/utils/request'

// 加入购物车
export const addGoodsCart = (goodsId, goodsNum, goodsName, goodsPrice, goodsImage) => {
  console.log(goodsImage)
  return request.post('/cart/add', {
    goodsId,
    goodsNum,
    goodsName,
    goodsPrice,
    goodsImage
  })
}

// 获取购物车列表数据
export const getCartList = () => {
  return request.get('/cart/list')
}

// 更新购物车商品数量
export const changeCount = (id, goodsNum) => {
  return request.post('/cart/update', {
    id,
    goodsNum
  })
}

// 删除购物车
export const delSelect = (cart) => {
  return request.post('/cart/clear', cart)
}
